Skip to content

feat(android): update session replay masking precedence rules#518

Open
beekld wants to merge 4 commits intomainfrom
beeklimt/O11Y-1397
Open

feat(android): update session replay masking precedence rules#518
beekld wants to merge 4 commits intomainfrom
beeklimt/O11Y-1397

Conversation

@beekld
Copy link
Copy Markdown
Contributor

@beekld beekld commented May 1, 2026

Summary

Changes Android semantics to match iOS when applying session replay masking precedence rules.

This changes existing masking behavior, but should be clearer than the previous behavior. Please see the README changes for details.

How did you test this change?

Unit tests added.

Are there any deployment considerations?

N/A


Note

Medium Risk
Changes core session replay privacy behavior by introducing explicit mask/unmask precedence and new propagation semantics, which could alter what gets redacted in captured sessions. Risk is mitigated by added unit tests covering the new precedence rules.

Overview
Aligns Android session replay masking with a strict precedence model: explicit masks (including maskXMLViewIds) propagate to descendants and always win, explicit unmasking (ldUnmask) propagates but only when no explicit mask applies, and global privacy options (maskTextInputs, maskText, view/webview/keyword heuristics) apply only to the matched target.

Implements this by splitting PrivacyProfile matchers into explicitMaskMatchers vs globalMaskMatchers, adding hasLDUnmask() support for both native views and Compose semantics, and updating MaskCollector traversal to carry inherited explicit state. Documentation is updated to describe the rules, new masking APIs are clarified, and new MaskCollectorTest cases validate precedence/propagation behavior; React Native Android adapter switches Observability logging to LDObserveLogging.adapter().

Reviewed by Cursor Bugbot for commit f2f5317. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld beekld requested a review from a team as a code owner May 1, 2026 00:53
@beekld beekld force-pushed the beeklimt/O11Y-1397 branch from 840995a to f2f5317 Compare May 1, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants